#include "shm.hpp"
#include "fifo.hpp"
int main()
{
    // 以写的方式打开命名管道
    FileOpen writerfile(PATH, FILENAME);
    writerfile.OpenForWrite();
    // 作为使用者，打开创建者所创建的共享内存
    Shm shm(pathname, projid, USER);
    char *mem = (char *)shm.RetAddress();
    int index = 0;
    for (char c = 'A'; c <= 'Z'; c++, index += 2)
    {
        // 才是向共享内存写入
        sleep(1);
        mem[index] = c;
        mem[index + 1] = c;
        sleep(1);
        mem[index + 2] = 0;

        writerfile.wakeup();
    }

    writerfile.Close();
    return 0;
}